import 'package:finance_app/generated/json/base/json_convert_content.dart';
import 'package:finance_app/generated/json/base/json_field.dart';
import 'package:finance_app/src/entities/ocr_attachment_entity.dart';
import 'package:finance_app/src/page/dashboard/amount_gst/amount_gst_rate_category_page.dart';

class ProductEntity with JsonConvert<ProductEntity> {
  @JSONField(name: "data_type")
  String dataType;
  int id;
  @JSONField(name: "company_id")
  int companyId;
  List<String> categories;
  dynamic category;
  String name;
  String code;
  dynamic barcode;
  @JSONField(name: "unit_type")
  String unitType;
  dynamic description;
  @JSONField(name: "enable_sell")
  int enableSell;
  @JSONField(name: "currency_code")
  String currencyCode;
  num price;
  @JSONField(name: "tax_id")
  int taxId;
  SettingDataTax tax;
  @JSONField(name: "is_tax_inclusive")
  int isTaxInclusive;
  @JSONField(name: "enable_purchase")
  int enablePurchase;
  @JSONField(name: "purchase_currency_code")
  String purchaseCurrencyCode;
  @JSONField(name: "purchase_price")
  num purchasePrice;
  @JSONField(name: "purchase_tax_id")
  int purchaseTaxId;
  @JSONField(name: "purchase_tax")
  SettingDataTax purchaseTax;
  @JSONField(name: "purchase_is_tax_inclusive")
  int purchaseIsTaxInclusive;
  @JSONField(name: "enable_inventory")
  int enableInventory;
  @JSONField(name: "inventory_left")
  int inventoryLeft;
  @JSONField(name: "has_inventory")
  int hasInventory;
  @JSONField(name: "has_bom")
  int hasBom;
  List<ProductBoms> boms;
  @JSONField(name: "is_activated")
  int isActivated;
  int enabled;
  @JSONField(name: "created_at")
  String createdAt;
  @JSONField(name: "updated_at")
  String updatedAt;
  List<OcrAttachmentEntity> attachments;
  @JSONField(name: "unit_type_text")
  String unitTypeText;
  @JSONField(name: "discount_type")
  String discountType;
  @JSONField(name: "discount_value")
  num discountValue;
}

class ProductBoms with JsonConvert<ProductBoms> {
  int id;
  @JSONField(name: "company_id")
  int companyId;
  String name;
  List<String> categories;
  String code;
  dynamic barcode;
  @JSONField(name: "unit_type")
  String unitType;
  String description;
  @JSONField(name: "enable_sell")
  int enableSell;
  @JSONField(name: "currency_code")
  String currencyCode;
  num price;
  @JSONField(name: "tax_id")
  int taxId;
  @JSONField(name: "is_tax_inclusive")
  int isTaxInclusive;
  @JSONField(name: "enable_purchase")
  int enablePurchase;
  @JSONField(name: "purchase_currency_code")
  String purchaseCurrencyCode;
  @JSONField(name: "purchase_price")
  num purchasePrice;
  @JSONField(name: "purchase_tax_id")
  int purchaseTaxId;
  @JSONField(name: "purchase_is_tax_inclusive")
  int purchaseIsTaxInclusive;
  @JSONField(name: "enable_inventory")
  int enableInventory;
  @JSONField(name: "inventory_left")
  int inventoryLeft;
  @JSONField(name: "has_bom")
  int hasBom;
  @JSONField(name: "is_activated")
  int isActivated;
  int enabled;
  @JSONField(name: "created_by")
  dynamic createdBy;
  @JSONField(name: "created_at")
  String createdAt;
  @JSONField(name: "updated_at")
  String updatedAt;
  @JSONField(name: "deleted_at")
  dynamic deletedAt;
  ProductBomsPivot pivot;
  @JSONField(name: "unit_type_text")
  String unitTypeText;
}

class ProductBomsPivot with JsonConvert<ProductBomsPivot> {
  @JSONField(name: "product_id")
  int productId;
  @JSONField(name: "material_id")
  int materialId;
  int quantity;
}
